let express = require('express');
let router = express.Router();
let filter = require('../../components/filter');
let path = require('path');

router.get('/management.v', filter.authorize, function (req, res, next) {
    res.sendFile(path.join(global.dirname, '../TrainExamClient/src', 'management.html'));

});

router.get('/exam.v', filter.authorize, function (req, res, next) {
    res.sendFile(path.join(global.dirname, '../TrainExamClient/src', 'exam.html'));
});

router.get('/train.v', filter.authorize, function (req, res, next) {
    res.sendFile(path.join(global.dirname, '../TrainExamClient/src', 'train.html'));
});

router.get('/download/:name', filter.authorize, function (req, res, next) {
    res.download(global.dirname + global.uploadPath + '/' + req.params.name);
});

module.exports = router;